﻿Public Class CircleGrids
    Inherits WindBase

    ''' <summary>
    ''' 圆圈的个数
    ''' </summary>
    ''' <remarks></remarks>
    Private m_Sectors As Integer = 4

    ''' <summary>
    ''' 圆圈的个数。分为4，8，12，16，20，24，28，32，36
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Sectors() As Integer
        Get
            Return m_Sectors
        End Get
        Set(ByVal value As Integer)
            m_Sectors = value
        End Set
    End Property
    Public Sub Draw(ByVal grap As Graphics, ByVal R As Single, ByVal Location As PointF)
        PenProperty.Width = PenProperty.Width * PannelSetting.gScale / PannelSetting.PreScale '当比例发生变化时需要高速画笔的宽度
        For i As Integer = 0 To m_Sectors
            Dim m_Pen As New Pen(Color.FromArgb(PenProperty.color))
            m_Pen.DashStyle = PenProperty.DashStyle
            m_Pen.Width = PenProperty.Width
            If Visible Then '如果可见就绘制坐标轴的轴线
                grap.DrawLine(m_Pen, Location.X, Location.Y, Location.X + CSng(R * Math.Cos(2 * Math.PI / m_Sectors * i)), Location.Y + CSng(R * Math.Sin(2 * Math.PI / m_Sectors * i)))
            End If
        Next
    End Sub
End Class
